from django.db import models

# Create your models here.
class Business(models.Model):
	caption = models.CharField(max_length=32)
	code = models.CharField(max_length=32,default='SA')

class Host(models.Model):
	nid = models.AutoField(primary_key=True)
	hostname = models.CharField(max_length=32,db_index=True)
	ip = models.GenericIPAddressField(db_index=True,protocol='both')
	port = models.IntegerField()
	b = models.ForeignKey('Business',on_delete=models.SET_NULL,to_field='id',null=True)

class Application(models.Model):
	name = models.CharField(max_length=32)
	r = models.ManyToManyField("Host")